package com.ss.gReader;

import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;
import javafx.stage.StageStyle;

import java.io.IOException;
import java.text.DecimalFormat;

public class App extends Application {


    private double opacity = 1;

    @Override
    public void start(Stage stage) throws IOException {
        Parent root = FXMLLoader.load(getClass().getResource("/Main.fxml"));
//        root.setStyle("-fx-background:'#66ccff'");
//        root.setOnScroll(scrollEvent -> {
//            if (scrollEvent.getDeltaY() > 0) {
//                opacity = opacity + 0.1 < 1 ? opacity + 0.1 : 1;
//            } else if (scrollEvent.getDeltaY() < 0){
//                opacity = opacity - 0.1 < 0 ? 0 : opacity - 0.1;
//            }
//            DecimalFormat df = new DecimalFormat("#.00");
//            root.setStyle("-fx-opacity:" + df.format(opacity));
//        });
        Scene scene = new Scene(root);
//        scene.setFill(null);
//        stage.initStyle(StageStyle.TRANSPARENT);
        stage.setScene(scene);
        stage.show();
    }
}
